<div class="pageContent" name="configPanel">
	<form class="pageForm required-validate">
		<div class="pageHeader">
		<div class="searchBar">
			<input type="hidden" name="navTabId" value="${navTabId!''}">
			<ul class="searchContent">
				<li><label><@label key="RootLanguageCode.C,colon">源语言：</@label></label>
					<select id="sourceLanguage">
						<option value="">默认</option> 
						<#list languages as language>
							<option value="${language.languageCode!''}" <#if sourceLanguage?? && sourceLanguage == '${language.languageCode}'>selected</#if>>
							${language.languageName!''}
							</option>
						</#list>
					</select>
				</li>
				<li><label><@label key="targetLanguageCode.C,colon">目标语言：</@label></label>
					<select id="targetLanguage"> 
						<#list languages as language>
						<option value="${language.languageCode!''}" <#if targetLanguage?? && targetLanguage == '${language.languageCode}'>selected</#if>>
						${language.languageName!''}
						</option>
						</#list>
					</select>
				</li>
			</ul>
			<ul class="searchContent">
				<li><label><@label key="LocaleResourceSet.C,colon">本地化资源集：</@label></label>
					<input id="resourceSet" value="${resourceSet!''}" type="text" maxlength="255" class="toUp" size="150" />
				</li>
				<li><label><@label key="localeresourcekey.C,colon">本地化资源键：</@label></label>
					<input id="resourceKey" value="${resourceKey!''}" type="text" maxlength="255" class="toUp" size="150" />
				</li>
			</ul>
			<ul class="searchContent">
				<li>
					<div class="buttonActive">
						<div class="buttonContent">
							<button id="next" type="button" name="btnNext">下一步</button>
						</div>
					</div>
				</li>
			</ul>
		</div>
		</div>
	</form>
</div>
<script type="text/javascript">
(function($){
	var $page = DWZ.context(), $form = $('form', $page), $button = $('#next', $form).on('click', function(){
		var $sourceLanguage = $('#sourceLanguage', $form),
		$targetLanguage = $('#targetLanguage', $form);
		if ($sourceLanguage[0].selectedIndex == $targetLanguage[0].selectedIndex + 1) {
			alertMsg.error("源语言和目标语言相同，请选择不同的语言进行翻译操作。");
		} else {
			navTab.openTab("${navTabId!''}", hostUrl + '/localeResourceTL/localeResourceTL_list' , {
				data: {
					navTabId: "${navTabId!''}",
					resourceSet: $('#resourceSet', $form).val(),
					resourceKey: $('#resourceKey', $form).val(),
					sourceLanguage: $sourceLanguage.val(),
					targetLanguage: $targetLanguage.val()
				},
				title : '本地化资源翻译',
				fresh : true,
				external : false
			});
		}
	});
	$form.on('keydown', 'select,input', function(event) {
		var e = event || window.event;
		if (e.keyCode === 13) {
			$button.click();
			return false;
		}
	});
})(jQuery);
</script>